﻿using System;
using System.Runtime.Serialization;
using nRoute.Components;
using nRoute.Internal;

namespace nRoute.SiteMaps
{
    [CollectionDataContract(Name = "Dependencies", ItemName = "AreaInfo")]
    [KnownType(typeof(SiteAreaInfo))]
    public class AreaInfosCollection
        : KeyedObservableCollection<string, SiteAreaInfo>
    {
        public AreaInfosCollection() 
            : base(StringComparer.InvariantCultureIgnoreCase) { }

#region Overrides

        protected override string GetKeyForItem(SiteAreaInfo item)
        {
            Guard.ArgumentNotNull(item, "item");
            return item.Key;
        }

#endregion

    }
}
